<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core">

    <p:panel header="FINALIZANDO PRACTICAS" style="border: none;">
        <div align="center" style="border-style: solid; border-color: #069; font-weight: bold; width: 99%">
            <h:form style="width: 70%">
                <p><h:outputText value="FINAL DE PRACTICAS" style="font-weight: bold; font-size: 18px; color:#069;"/></p>
                <br/>
                
                <p:fileUpload fileUploadListener="#{practiceProcessBean.handleFileUpload}" 
                              mode="advanced" uploadLabel="Subir Archivo" cancelLabel="Cancelar"
                              dragDropSupport="false"  invalidFileMessage="SOLO PDF, "
                              invalidSizeMessage="MAXIMO 20MB, "
                              fileLimitMessage="Solo puede subir un archivo"
                              sizeLimit="32457280" fileLimit="1" 
                              allowTypes="/(\.|\/)(pdf)$/" />  
                
            </h:form>
            
            <h:form id="formReportId">
                <h:panelGrid columns="2">
                    <h:outputText value="Fecha de entrega: "/>
                    <p:calendar locale="es" value="#{practiceProcessBean.reportPracticeFinal.filingDate}"
                                required="true" label="Fecha"/>
                    
                    <h:outputText value="Comentario Final: "/>
                    <p:inputTextarea autoResize="false" style="width: 250px;" 
                                     value="#{practiceProcessBean.reportPracticeFinal.detail}"
                                     maxlength="499" required="true" label="Comentario"/>
                    
                </h:panelGrid>
                <p:commandButton value="Guardar Info" icon="ui-icon-disk" update=":panelCenter"
                                 onstart="PF('blockUI').block();" oncomplete="PF('blockUI').unblock();"
                                 action="#{practiceBean.initCollection()}" >
                    <f:actionListener binding="#{practiceProcessBean.saveReportPracticeFinal()}" />
                    <f:setPropertyActionListener value="./content/practice.xhtml" target="#{indexLoginBean.navigation}"/>
                </p:commandButton>
            </h:form>
            
            <br/><br/>
        </div>
    </p:panel>
</ui:composition>
